import { FlowNode } from "../domain/models/flowNode";
import { Transaction } from "tiny-entity2";
import { ApiDataContext } from "../domain/apiDataContext";
import { BaseService } from "./baseService";

export class FlowNodeService extends BaseService {
    CreateFlowNode(entity: FlowNode, ctx?: ApiDataContext) {
        ctx || (ctx = new ApiDataContext());
        return Transaction(ctx, async (ctx) => {
            let d = new FlowNode();
            d.ConverToEntity(entity);
            return ctx.Create(d);
        });
    }
    UpdateFlowNode(entity: FlowNode, ctx?: ApiDataContext) {
        ctx || (ctx = new ApiDataContext());
        return Transaction(ctx, async (ctx) => {
            let d = new FlowNode();
            d.ConverToEntity(entity);
            return ctx.Create(d);
        });
    }
    GetFlowNodeById(id: string) {
        let ctx = new ApiDataContext();
    }
    QueryFlowNode(params) {
        let ctx = new ApiDataContext();
    }
}